package com.softeem.xyblogmaster.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.softeem.xyblogmaster.domain.Comments;
import com.softeem.xyblogmaster.service.CommentsService;
import com.softeem.xyblogmaster.mapper.CommentsMapper;
import com.softeem.xyblogmaster.util.PageInfo;
import org.springframework.stereotype.Service;

/**
* @author 段伟韬的笔记本
* @description 针对表【blog_comments】的数据库操作Service实现
* @createDate 2025-04-15 16:31:04
*/
@Service
public class CommentsServiceImpl extends ServiceImpl<CommentsMapper, Comments>
    implements CommentsService{

    @Override
    public PageInfo page(int page, int limit, String keyword) {
        LambdaQueryWrapper<Comments> lambdaQueryWrapper=new LambdaQueryWrapper();
        lambdaQueryWrapper.like(Comments::getReviewer,"%"+keyword+"%");
        Page pages= this.page(new Page<Comments>(page, limit), lambdaQueryWrapper);
        PageInfo pageInfo=new PageInfo(pages,7);
        return pageInfo;
    }
}




